package com.guapi.dao;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Objects;

@TableName("job")
@Data
public class SystemJob extends BaseDao {

    @TableField("bean_name")
    private String beanName;

    @TableField("method_name")
    private String methodName;

    @TableField("method_params")
    private String methodParams;

    @TableField("cron_expression")
    private String cronExpression;

    private String remark;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        SystemJob systemJob = (SystemJob) o;
        return Objects.equals(beanName, systemJob.beanName) && Objects.equals(methodName, systemJob.methodName) && Objects.equals(methodParams, systemJob.methodParams) && Objects.equals(cronExpression, systemJob.cronExpression);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), beanName, methodName, methodParams, cronExpression);
    }
}
